using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class PlayerHP : MonoBehaviour
{
    public RawImage ImgTens;
    public RawImage ImgOnes;

    public Player player;

    private void Awake()
    {
    }

    // Update is called once per frame
    void Update()
    {
        int tens = Mathf.FloorToInt((player.HP) / 10);
        int ones = Mathf.FloorToInt(player.HP % 10);
        if (null != ImgTens)
            ImgTens.texture = Resources.Load<Texture>(string.Format("Texture/Img_Number_{0}", tens));

        if (null != ImgOnes)
            ImgOnes.texture = Resources.Load<Texture>(string.Format("Texture/Img_Number_{0}", ones));
    }
}
